package schoolWork;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-11-13
 * Time: 14:52
 */
abstract class Car {
    int wheelNum;
    int seatNum;
    public void display() {
        System.out.println("Car抽象类的方法");
    }
}
class Bus extends Car {
    public void display() {
        System.out.println("bus类的方法");
    }
}
class Motoreycle extends Car {
    public void display() {
        System.out.println("Motoreycle的方法");
    }
}
public class Test3 {
    public static void main(String[] args) {
        Car car = new Bus();//向上转型
        car.display();
    }
}
